﻿@model INFDTM01.ViewModels.CreateUsersFromFile

@{
    ViewBag.Title = "User";
}

<h2>100,000 ratings from 1000 users on 1700 movies</h2>

<table>
    <tr>
        <th>User Id</th>
        <th>Item Id</th>
        <th>Rating</th>
    </tr>
    @foreach (KeyValuePair<int, INFDTM01.Models.UserPreference> pair in Model.UserPreferences)
    {
        for (int i = 0; i < pair.Value.ItemIds.Count(); i++)
        {
            <tr>
                <td>@pair.Value.UserId</td>
                <td>@pair.Value.ItemIds[i]</td>
                <td>@pair.Value.Preferences[i]</td>
            </tr>
        }
    }
</table>

<table>
    <tr>
        <th>Top 10 Similarities</th>
    </tr>
    @foreach (KeyValuePair<int, double> pair in Model.UserSimilarities)
    {
        <tr>
            <td>@pair.Value</td>
        </tr>
    }
</table>

<table>
    <tr>
        <th>Item</th>
        <th>Ranking</th>
        <th></th>
    </tr>
    @foreach (KeyValuePair<int, double> pair in Model.Rankings)
    {
        <tr>
            <td>@pair.Key</td>
            <td>@pair.Value</td>
            <td><a href="/user/searchmovie/@pair.Key">Details</a></td>
        </tr>
    }
</table>

<table id="performance">
    <tr>
        <td style="width: 200px;"><strong>Reading data in seconds</strong></td>
        <td>@Model.ReadingTimeInSeconds</td>
    </tr>
    <tr>
        <td><strong>Reading data in milliseconds</strong></td>
        <td>@Model.ReadingTimeInMilliSeconds</td>
    </tr>
    <tr>
        <td><strong>Calculation in seconds</strong></td>
        <td>@Model.CalculationInSeconds</td>
    </tr>
        <td><strong>Calculation in milliseconds</strong></td>
        <td>@Model.CalculationInMilliSeconds</td>
    <tr>
    </tr>
</table>